package com.group.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 问题
 * 
 * @author zhaolei
 *
 */
public class BrainQuestion {

	private Long id;

	/**
	 * 问题内容
	 */
	private String content;

	/**
	 * 答案 a b c d的内容
	 */
	private String a;

	private String b;

	private String c;

	/**
	 * 正确答案
	 */
	private String right;

	/**
	 * user1答案
	 */
	private String answer1;

	/**
	 * user2答案
	 */
	private String answer2;

	/**
	 * 获取一个错误答案
	 * 
	 * @return
	 */
	public String getWrong() {
		List<String> result = new ArrayList<>();
		if (!right.equals(a))
			result.add(a);
		if (!right.equals(b))
			result.add(b);
		if (!right.equals(c))
			result.add(c);
		Collections.shuffle(result);
		return result.get(0);
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getA() {
		return a;
	}

	public void setA(String a) {
		this.a = a;
	}

	public String getB() {
		return b;
	}

	public void setB(String b) {
		this.b = b;
	}

	public String getC() {
		return c;
	}

	public void setC(String c) {
		this.c = c;
	}

	public String getRight() {
		return right;
	}

	public void setRight(String right) {
		this.right = right;
	}

	public String getAnswer1() {
		return answer1;
	}

	public void setAnswer1(String answer1) {
		this.answer1 = answer1;
	}

	public String getAnswer2() {
		return answer2;
	}

	public void setAnswer2(String answer2) {
		this.answer2 = answer2;
	}

}
